package iammry.com.activity;

import android.graphics.drawable.AnimationDrawable;
import android.os.Handler;
import android.os.Message;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.lidroid.xutils.view.annotation.ViewInject;

import iammry.com.R;
import iammry.com.base.BaseActivity;


public class ScanBlueActivity extends BaseActivity {

	@ViewInject(R.id.scanningblue_iv_loadanimal)
	ImageView scanningblue_iv_loadanimal;

	@ViewInject(R.id.tv_tittle)
	TextView tv_tittle;
	
	@ViewInject(R.id.ll_back)
	LinearLayout ll_back;

	public Handler mHandler=new Handler()
	{
		@Override
		public void handleMessage(Message msg) {
			super.handleMessage(msg);
		}
	};


	@Override
	protected void initView()
	{
		setLayout(this, R.layout.scanningblue_layout);
		scanningblue_iv_loadanimal.setBackgroundResource(R.drawable.scanblue_animal);
		startAnima();
	}

	@Override
	protected void initData()
	{
		
		tv_tittle.setText("发现Mr.Y");
		mHandler.postDelayed(new Runnable() {
			@Override
			public void run() {
				startActivity(ShookActivity.class);
			}
		},1000);

		//finish();
	}

	@Override
	protected void initEvent() 
	{
		
		ll_back.setOnClickListener(new OnClickListener() {
			
			@Override
			public void onClick(View arg0)
			{
				finish();
			}
		});
	}
	
	/**
	 * start animal
	 */
	private void startAnima() 
	{
		AnimationDrawable anim = (AnimationDrawable) scanningblue_iv_loadanimal
				.getBackground();
		anim.start();
	}

}
